﻿using MediatR;
using System;
using System.Collections.Generic;
using System.Text;

namespace xiaodingmarket_Domain_core.Events
{
    //命令与事件的源头，，获取我们事件请求的类型
    //IRequest来抽象单播消息,子类为消息请求,,无返回值的时候是继承IRequest
    public abstract class Message : IRequest<bool>
    {
        /// <summary>
        /// 消息类型：实现Message的命令或事件类型
        /// </summary>
        public string MessageType { get; protected set; }
        /// <summary>
        /// 聚合ID
        /// </summary>
        public Guid AggregateId { get; protected set; }

        protected Message()
        {
            MessageType = GetType().Name;
        }
    }
}
